package net.samsb.tool;

import android.util.Log;

import static net.samsb.activity.Constants.ZERO_NUM;

/**
 * Created by Destiny_hao on 2018/3/24.
 */

public class UrlTools {

    public static String formatNum(String num) {
        return String.format("%0" + ZERO_NUM + "d", Integer.parseInt(num));
    }

    public static String formatURL(String domain, String fileUrl, String imgName, String imgSuffix) {
        String URL = "http://%s/%s/%s.%s";
        Log.e("图片地址：", String.format(URL, domain, fileUrl, imgName, imgSuffix));
        return String.format(URL, domain, fileUrl, imgName, imgSuffix);
    }

    public static String formatURL(String domain, String imgName) {
        String URL = "http://%s/%s";
        Log.e("图片地址：", String.format(URL, domain, imgName));
        return String.format(URL, domain, imgName);
    }
}
